package com.yuntian.mapper;


import com.yuntian.entity.AppUser;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * @author yuntian
 * @date 2025/10/22
 */
@Mapper
public interface AppUserMapper {

    /**
     * 获取用户信息
     */
    @Select("select * from app_user")
    List<AppUser> getAppUser();

     /**
      * 保存用户信息
      */
     @Insert("insert into app_user (user_id, username, user_pass, create_time, update_time) " +
             "values (#{userId}, #{userName}, #{userPass}, #{createTime}, #{updateTime})")
    void insert(AppUser appUser);
     /**
      * 更新用户信息
      */
    @Update("update app_user set username=#{userName}, user_pass=#{userPass}, update_time=#{updateTime} where user_id=#{userId}")
    void update(AppUser appUser);

    /**
     * 删除用户信息
     */
     @Delete("delete from app_user where user_id=#{userId}")
    void delete(Integer appUser);
}
